package ovm.management.news;

import ovm.entity.NewsEntity;
import ovm.management.AbstractManager;

import javax.persistence.Query;
import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: Jokser
 * Date: 07.06.12
 * Time: 18:36
 * To change this template use File | Settings | File Templates.
 */

public class NewsManager extends AbstractManager {

    public static ArrayList<NewsEntity> getAllNews () {
        Query query = em.createQuery("SELECT e FROM NewsEntity e ORDER BY e.nDate desc");
        return (ArrayList<NewsEntity>) query.getResultList();
    }
    
}
